const initState = { num: 100 }
export const rootRudcer = (state=initState, action) =>{
    console.log(action)
    switch (action.type) {
        case 'sub':
            return Object.assign({}, state, {num: state.num - action.value})
        case 'add':
            return Object.assign({}, state, {num: state.num + action.value})
        default:
            return state
    }
}